/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufba.lasid.v1.utils;

import java.io.PrintStream;

/**
 *
 * @author aliriosa
 */
public class Debugger {
    
    public static boolean Debug = true;
    public static PrintStream Output = System.out;
    
    public static boolean isDebuging() {
        return Debugger.Debug;
    }
    
    public static void turnoff(){
        Debugger.Debug = false;
    }

    public static void turnon(){
        Debugger.Debug = true;
    }
        
    public static void setDebug(boolean debug) {
        Debugger.Debug = debug;
    }

    public static void setOutput(PrintStream output){
        Debugger.Output = output;
    }
    public synchronized static void debug(String txt){
        if(isDebuging()) {
            Output.println("[DEBUG]" + "[" + Clock.getDate() + "] " + txt);
        }
    }
    
}
